/* VSCode 风格的 CSS */
:root {
    --vscode-bg: #1e1e1e;
    --vscode-sidebar-bg: #252526;
    --vscode-header-bg: #252526;
    --vscode-panel-bg: #1e1e1e;
    --vscode-text-primary: #d4d4d4;
    --vscode-text-secondary: #969696;
    --vscode-border: #3e3e42;
    --vscode-active-tab: #007acc;
    --vscode-button-hover: #37373d;
    --vscode-button-active: #0e639c;
    --vscode-input-bg: #3c3c3c;
    --vscode-input-border: #5a5a5a;
    --vscode-success: #4ec9b0;
    --vscode-error: #f48771;
    --vscode-warning: #ce9178;
    --vscode-info: #569cd6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe WPC', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--vscode-bg);
    color: var(--vscode-text-primary);
    line-height: 1.6;
    overflow: hidden;
}

/* VSCode 布局容器 */
.vscode-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* 顶部导航栏 */
.vscode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--vscode-header-bg);
    padding: 10px 20px;
    border-bottom: 1px solid var(--vscode-border);
    flex-shrink: 0;
    min-height: 44px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.app-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--vscode-text-primary);
}

.connection-tabs {
    display: flex;
    gap: 2px;
    background-color: var(--vscode-bg);
    padding: 2px;
    border-radius: 4px;
}

.tab-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--vscode-text-secondary);
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background-color: var(--vscode-button-hover);
    color: var(--vscode-text-primary);
}

.tab-btn.active {
    background-color: var(--vscode-active-tab);
    color: white;
}

.header-right {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--vscode-text-secondary);
    align-items: center;
    margin-left: auto;
}
}

#connection-status.connected {
    color: var(--vscode-success);
}

#connection-status.disconnected {
    color: var(--vscode-error);
}

#connection-status-span.status-connected {
    color: var(--vscode-success);
}

#connection-status-span.status-disconnected {
    color: var(--vscode-warning);
}

.vscode-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧边栏 */
.vscode-sidebar {
    width: 300px;
    background-color: var(--vscode-sidebar-bg);
    border-right: 1px solid var(--vscode-border);
    overflow-y: auto;
    flex-shrink: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    padding: 15px;
    border-bottom: 1px solid var(--vscode-border);
}

.sidebar-section h3 {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--vscode-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 右侧边栏 */
.vscode-sidebar-right {
    width: 300px;
    background-color: var(--vscode-sidebar-bg);
    border-left: 1px solid var(--vscode-border);
    overflow-y: auto;
    flex-shrink: 0;
    padding: 16px;
}

/* 主内容区 */
.vscode-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    gap: 16px;
}

/* 底部状态栏 */
.vscode-statusbar {
    background-color: var(--vscode-header-bg);
    border-top: 1px solid var(--vscode-border);
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    color: var(--vscode-text-secondary);
}

.statusbar-right {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

/* 底部面板 */
.vscode-footer {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--vscode-border);
    background-color: var(--vscode-bg);
}

.vscode-footer .logs-panel {
    flex: 1;
    min-height: 228px;
}

/* API部分样式 */
.api-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-category {
    background-color: var(--vscode-button-hover);
    border-radius: 4px;
    padding: 12px;
}

.api-category .feature-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--vscode-text-primary);
}

/* 面板样式 */
.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-header {
    padding: 10px 15px;
    background-color: var(--vscode-header-bg);
    border-bottom: 1px solid var(--vscode-border);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--vscode-text-primary);
}

.panel-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* 输入组样式 */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--vscode-text-secondary);
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    background-color: var(--vscode-input-bg);
    border: 1px solid var(--vscode-input-border);
    border-radius: 3px;
    color: var(--vscode-text-primary);
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--vscode-active-tab);
}

textarea {
    min-height: 80px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.button-group.vertical {
    flex-direction: column;
}

button {
    padding: 8px 12px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--vscode-active-tab);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--vscode-button-active);
}

.btn-success {
    background-color: var(--vscode-success);
    color: #1e1e1e;
}

.btn-success:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-danger {
    background-color: var(--vscode-error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-warning {
    background-color: var(--vscode-warning);
    color: #1e1e1e;
}

.btn-warning:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-info {
    background-color: var(--vscode-info);
    color: white;
}

.btn-info:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-secondary {
    background-color: var(--vscode-button-hover);
    color: var(--vscode-text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--vscode-input-bg);
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 认证设置信息样式 */
.info-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--vscode-border);
}

.info-section h4 {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--vscode-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-methods {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.auth-method {
    display: block;
    padding: 4px 8px;
    background-color: var(--vscode-input-bg);
    border-radius: 3px;
    font-size: 12px;
    color: var(--vscode-text-primary);
}

.info-text {
    font-size: 11px;
    color: var(--vscode-text-secondary);
    line-height: 1.4;
}

/* 认证设置样式 */
.auth-setting {
    margin-bottom: 10px;
}

.auth-setting label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox {
    width: auto;
    accent-color: var(--vscode-active-tab);
}

/* 认证详情区域 */
.auth-details {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--vscode-sideBarSectionHeader-background);
    border-radius: 4px;
}

.auth-settings {
    margin-top: 8px;
}

.auth-details .input-group {
    margin-bottom: 8px;
}

.auth-details select {
    width: 100%;
    padding: 6px 8px;
    background-color: var(--vscode-input-background);
    color: var(--vscode-input-foreground);
    border: 1px solid var(--vscode-input-border);
    border-radius: 3px;
    font-size: 13px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

input[type="checkbox"] {
    width: auto;
    accent-color: var(--vscode-active-tab);
}

/* 功能网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.feature-card {
    background-color: var(--vscode-sidebar-bg);
    border: 1px solid var(--vscode-border);
    border-radius: 4px;
    padding: 12px;
}

.feature-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--vscode-text-primary);
}

.feature-card .button-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 日志样式 */
.logs {
    background-color: var(--vscode-bg);
    border: 1px solid var(--vscode-border);
    border-radius: 3px;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* 日志容器样式 - 固定大小并始终显示滚动条 */
#log-container {
    background-color: var(--vscode-bg);
    border: 1px solid var(--vscode-border);
    border-radius: 3px;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* 为日志容器设置始终可见的滚动条 */
#log-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 100, 100, 0.5) transparent;
}

/* Webkit浏览器的日志容器滚动条样式 */
#log-container::-webkit-scrollbar {
    width: 8px;
}

#log-container::-webkit-scrollbar-track {
    background: transparent;
}

#log-container::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 100, 0.5);
    border-radius: 4px;
}

#log-container::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.7);
}

/* 自定义滚动条样式 - 使滚动条在滚动时出现 */
.vscode-sidebar, 
.vscode-sidebar-right, 
.vscode-main, 
.panel-content, 
.logs {
    /* 隐藏滚动条但保持功能 */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.2s ease;
}

/* 鼠标悬停或滚动时显示滚动条 */
.vscode-sidebar:hover, 
.vscode-sidebar-right:hover, 
.vscode-main:hover, 
.panel-content:hover, 
.logs:hover {
    scrollbar-color: rgba(100, 100, 100, 0.5) transparent;
}

/* Webkit 浏览器滚动条样式 */
.vscode-sidebar::-webkit-scrollbar,
.vscode-sidebar-right::-webkit-scrollbar,
.vscode-main::-webkit-scrollbar,
.panel-content::-webkit-scrollbar,
.logs::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.vscode-sidebar::-webkit-scrollbar-track,
.vscode-sidebar-right::-webkit-scrollbar-track,
.vscode-main::-webkit-scrollbar-track,
.panel-content::-webkit-scrollbar-track,
.logs::-webkit-scrollbar-track {
    background: transparent;
}

/* 默认隐藏滚动条滑块 */
.vscode-sidebar::-webkit-scrollbar-thumb,
.vscode-sidebar-right::-webkit-scrollbar-thumb,
.vscode-main::-webkit-scrollbar-thumb,
.panel-content::-webkit-scrollbar-thumb,
.logs::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

/* 鼠标悬停或滚动时显示滑块 */
.vscode-sidebar:hover::-webkit-scrollbar-thumb,
.vscode-sidebar-right:hover::-webkit-scrollbar-thumb,
.vscode-main:hover::-webkit-scrollbar-thumb,
.panel-content:hover::-webkit-scrollbar-thumb,
.logs:hover::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 100, 0.5);
}

/* 滚动条滑块悬停时样式 */
.vscode-sidebar::-webkit-scrollbar-thumb:hover,
.vscode-sidebar-right::-webkit-scrollbar-thumb:hover,
.vscode-main::-webkit-scrollbar-thumb:hover,
.panel-content::-webkit-scrollbar-thumb:hover,
.logs::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.7);
}

.log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
}

.log-entry.error {
    color: var(--vscode-error);
}

.log-entry.info {
    color: var(--vscode-success);
}

.log-entry.warn {
    color: var(--vscode-warning);
}

.log-entry.debug {
    color: var(--vscode-text-secondary);
}